home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / dalla rivista / amiga.free / diropus4.12b_gpl / config / main9.c < prev    next >
C/C++ Source or Header  |  2000-01-27  |  19KB  |  655 lines

  1. /*
  2.  
  3. Directory Opus 4
  4. Original GPL release version 4.12
  5. Copyright 1993-2000 Jonathan Potter
  6.  
  7. This program is free software; you can redistribute it and/or
  8. modify it under the terms of the GNU General Public License
  9. as published by the Free Software Foundation; either version 2
  10. of the License, or (at your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  20.  
  21. All users of Directory Opus 4 (including versions distributed
  22. under the GPL) are entitled to upgrade to the latest version of
  23. Directory Opus version 5 at a reduced price. Please see
  24. http://www.gpsoft.com.au for more information.
  25.  
  26. The release of Directory Opus 4 under the GPL in NO WAY affects
  27. the existing commercial status of Directory Opus 5.
  28.  
  29. */
  30.  
  31. #include "config.h"
  32. #include "ppdata.h"
  33.  
  34. void readhelp()
  35. {
  36.     int in;
  37.     char helpname[40],helpfilename[256];
  38.     char *pptemp;
  39.  
  40.     LFreeRemember(&helpkey);
  41.     helpbuffer=NULL;
  42.     helpsize=0;
  43.  
  44.     lsprintf(helpname,"CO_%s.HLP",config->language);
  45.     if (!config->language[0] ||
  46.         !(FindSystemFile(helpname,helpfilename,256,SYSFILE_DATA)))
  47.         FindSystemFile("ConfigOpus.HLP",helpfilename,256,SYSFILE_DATA);
  48.  
  49.     if (CheckExist(helpfilename,&helpsize)>=0) return;
  50.     if (PPBase &&
  51.         !(ppLoadData(helpfilename,DECR_NONE,MEMF_CLEAR,&pptemp,&helpsize,NULL))) {
  52.         if (helpbuffer=LAllocRemember(&helpkey,helpsize+1,MEMF_CLEAR))
  53.             CopyMem(pptemp,helpbuffer,helpsize);
  54.         FreeMem(pptemp,helpsize);
  55.     }
  56.  
  57.     if (!helpbuffer) {
  58.         if (!(in=Open(helpfilename,MODE_OLDFILE)) ||
  59.             !(helpbuffer=LAllocRemember(&helpkey,helpsize+1,MEMF_CLEAR))) {
  60.             if (in) Close(in);
  61.             return;
  62.         }
  63.         Read(in,helpbuffer,helpsize);
  64.         Close(in);
  65.     }
  66. }
  67.  
  68. void makehelpname(path)
  69. char *path;
  70. {
  71.     int a,b;
  72.  
  73.     if (path==(char *)-1) {
  74.         b=strlen(currenthelpname)-2;
  75.         for (a=b;a>=0;a--) {
  76.             if (currenthelpname[a]=='/') {
  77.                 currenthelpname[a]=0;
  78.                 break;
  79.             }
  80.         }
  81.     }
  82.     else TackOn(currenthelpname,path,256);
  83. }
  84.  
  85. void doconfighelp()
  86. {
  87.     int a,test=1;
  88.  
  89.     if (!helpbuffer) return;
  90.     for (a=0;a<helpsize;a++) {
  91.         if (helpbuffer[a]==0) {
  92.             if (test==-1) {
  93.                 busy();
  94.                 dohelpmsg(&helpbuffer[a+1]);
  95.                 unbusy();
  96.                 return;
  97.             }
  98.             if (test) test=0;
  99.             else test=1;
  100.         }
  101.         else if (test==1) {
  102.             if (LStrCmpI(&helpbuffer[a],currenthelpname)==0) test=-1;
  103.             else ++test;
  104.         }
  105.     }
  106. }
  107.  
  108. void dohelpmsg(text)
  109. char *text;
  110. {
  111.     struct Window *wind;
  112.     char **helpbuf,*buf;
  113.     int size,lines,a,b,pos;
  114.     struct DOpusListView *view;
  115.     ULONG class;
  116.     USHORT gadgetid;
  117.     struct DOpusRemember *key=NULL;
  118.  
  119.     size=strlen(text);
  120.     if (!(buf=LAllocRemember(&key,size+1,MEMF_CLEAR))) return;
  121.     for (a=0,lines=0;a<size;a++) {
  122.         if (text[a]=='\n') {
  123.             buf[a]=0;
  124.             ++lines;
  125.         }
  126.         else buf[a]=text[a];
  127.     }
  128.     if (!(helpbuf=LAllocRemember(&key,(lines+2)*4,MEMF_CLEAR))) {
  129.         LFreeRemember(&key);
  130.         return;
  131.     }
  132.     for (a=0,b=0,pos=0;a<size;a++) {
  133.         if (pos==0) {
  134.             helpbuf[(b++)]=&buf[a];
  135.             if (b>lines) break;
  136.         }
  137.         if (buf[a]==0) pos=0;
  138.         else ++pos;
  139.     }
  140.  
  141.     setup_list_window(&requestwin,&helplist,&helpcancelgad,1);
  142.  
  143.     requestwin.Title=currenthelpname;
  144.     if (wind=openwindow(&requestwin)) {
  145.         setuplist(&helplist,-1,-1);
  146.         helplist.items=helpbuf;
  147.         helplist.flags|=DLVF_DUMB;
  148.         helplist.topitem=0;
  149.         helplist.window=wind;
  150.         if (AddListView(&helplist,1)) {
  151.             SetAPen(wind->RPort,screen_pens[1].pen);
  152.             AddGadgets(wind,
  153.                 &helpcancelgad,
  154.                 editfuncgads,
  155.                 1,
  156.                 screen_pens[config->gadgettopcol].pen,screen_pens[config->gadgetbotcol].pen,1);
  157.             FOREVER {
  158.                 Wait(1<<wind->UserPort->mp_SigBit);
  159.                 while (IMsg=(struct IntuiMessage *)GetMsg(wind->UserPort)) {
  160.                     if ((view=ListViewIDCMP(&helplist,IMsg))==(struct DOpusListView *)-1) {
  161.                         class=IMsg->Class;
  162.                         if (class==IDCMP_GADGETUP)
  163.                             gadgetid=((struct Gadget *)IMsg->IAddress)->GadgetID;
  164.                         ReplyMsg((struct Message *)IMsg);
  165.                         if (class==IDCMP_GADGETUP && gadgetid==0) goto endhelp;
  166.                     }
  167.                 }
  168.             }
  169. endhelp:
  170.             RemoveListView(&helplist,1);
  171.         }
  172.         CloseWindow(wind);
  173.     }
  174.     LFreeRemember(&key);
  175. }
  176.  
  177. /*
  178. struct clipboard_data {
  179.     long form;
  180.     long length;
  181.     long docp;
  182.     long size;
  183. };
  184.  
  185. void load_clips()
  186. {
  187.     struct Clip clip,*curclip=NULL,*newclip;
  188.     struct clipboard_data cdata;
  189.     char *funcbuf;
  190.  
  191.     if (!clip_io ||
  192.         (OpenDevice("clipboard.device",0,(struct IORequest *)clip_io,0))) return;
  193.  
  194.     clip_io->io_Error=0;
  195.     clip_io->io_ClipID=0;
  196.  
  197.     clip_io->io_Command=CMD_READ;
  198.     clip_io->io_Data=(char *)&cdata;
  199.     clip_io->io_Length=sizeof(struct clipboard_data);
  200.     clip_io->io_Offset=0;
  201.  
  202.     if (!(DoIO((struct IORequest *)clip_io)) &&
  203.         cdata.form=='FORM' && cdata.docp=='DOCP') {
  204.  
  205.         FOREVER {
  206.             clip_io->io_Command=CMD_READ;
  207.             clip_io->io_Data=(char *)&clip;
  208.             clip_io->io_Length=sizeof(struct Clip);
  209.             if (DoIO((struct IORequest *)clip_io) ||
  210.                 clip_io->io_Actual<sizeof(struct Clip)) break;
  211.             if (clip.func.function &&
  212.                 (funcbuf=LAllocRemember(&clipkey,(int)clip.func.function,0))) {
  213.                 clip_io->io_Command=CMD_READ;
  214.                 clip_io->io_Data=funcbuf;
  215.                 clip_io->io_Length=(int)clip.func.function;
  216.                 if (DoIO((struct IORequest *)clip_io) ||
  217.                     clip_io->io_Actual<(int)clip.func.function) break;
  218.             }
  219.             else funcbuf=NULL;
  220.             clip.func.function=funcbuf;
  221.             if (newclip=LAllocRemember(&clipkey,sizeof(struct Clip),0)) {
  222.                 CopyMem((char *)&clip,(char *)newclip,sizeof(struct Clip));
  223.                 if (curclip) curclip->next=newclip;
  224.                 else firstclip=newclip;
  225.                 curclip=newclip;
  226.                 ++clipcount;
  227.             }
  228.         }
  229.     }
  230.  
  231.     CloseDevice((struct IORequest *)clip_io);
  232. }
  233.  
  234. void save_clips()
  235. {
  236.     int size=0;
  237.     struct Clip *clip;
  238.     struct clipboard_data cdata;
  239.     char *function;
  240.  
  241.     if (!clip_io ||
  242.         (OpenDevice("clipboard.device",0,(struct IORequest *)clip_io,0))) return;
  243.  
  244.     clip=firstclip;
  245.     while (clip) {
  246.         size+=sizeof(struct Clip);
  247.         if (clip->func.function) size+=strlen(clip->func.function)+1;
  248.         clip=clip->next;
  249.     }
  250.  
  251.     cdata.form='FORM';
  252.     cdata.length=size+8;
  253.     cdata.docp='DOCP';
  254.     cdata.size=size;
  255.  
  256.     clip_io->io_Error=0;
  257.     clip_io->io_ClipID=0;
  258.  
  259.     clip_io->io_Data=(char *)&cdata;
  260.     clip_io->io_Length=sizeof(struct clipboard_data);
  261.     clip_io->io_Command=CMD_WRITE;
  262.     clip_io->io_Offset=0;
  263.  
  264.     if (!(DoIO((struct IORequest *)clip_io))) {
  265.         clip=firstclip;
  266.         while (clip) {
  267.             if ((function=clip->func.function))
  268.                 clip->func.function=(char *)strlen(function)+1;
  269.  
  270.             clip_io->io_Data=(char *)clip;
  271.             clip_io->io_Length=sizeof(struct Clip);
  272.             clip_io->io_Command=CMD_WRITE;
  273.             if (DoIO((struct IORequest *)clip_io)) break;
  274.             if (function) {
  275.                 clip_io->io_Data=function;
  276.                 clip_io->io_Length=(int)clip->func.function;
  277.                 clip_io->io_Command=CMD_WRITE;
  278.                 if (DoIO((struct IORequest *)clip_io)) break;
  279.             }
  280.             clip=clip->next;
  281.         }
  282.     }
  283.  
  284.     clip_io->io_Command=CMD_UPDATE;
  285.     DoIO((struct IORequest *)clip_io);
  286.  
  287.     CloseDevice((struct IORequest *)clip_io);
  288. }
  289. */
  290.  
  291. void load_clips()
  292. {
  293.     struct Clip clip,*curclip=NULL,*newclip;
  294.     char *funcbuf;
  295.     int file;
  296.  
  297.     if (!(file=Open("t:configopus.clip",MODE_OLDFILE))) return;
  298.  
  299.     FOREVER {
  300.         if ((Read(file,(char *)&clip,sizeof(struct Clip)))<sizeof(struct Clip))
  301.             break;
  302.         if (clip.func.function &&
  303.             (funcbuf=LAllocRemember(&clipkey,(int)clip.func.function,0))) {
  304.             if ((Read(file,funcbuf,(int)clip.func.function))<(int)clip.func.function)
  305.                 break;
  306.         }
  307.         else funcbuf=NULL;
  308.         clip.func.function=funcbuf;
  309.         if (newclip=LAllocRemember(&clipkey,sizeof(struct Clip),0)) {
  310.             CopyMem((char *)&clip,(char *)newclip,sizeof(struct Clip));
  311.             if (curclip) curclip->next=newclip;
  312.             else firstclip=newclip;
  313.             curclip=newclip;
  314.             ++clipcount;
  315.         }
  316.     }
  317.  
  318.     Close(file);
  319. }
  320.  
  321. void save_clips()
  322. {
  323.     int file;
  324.     struct Clip *clip;
  325.     char *function;
  326.  
  327.     if (!(file=Open("t:configopus.clip",MODE_NEWFILE))) return;
  328.  
  329.     clip=firstclip;
  330.     while (clip) {
  331.         if ((function=clip->func.function))
  332.             clip->func.function=(char *)strlen(function)+1;
  333.         if ((Write(file,(char *)clip,sizeof(struct Clip)))<sizeof(struct Clip))
  334.             break;
  335.         if (function &&
  336.             ((Write(file,(char *)function,(int)clip->func.function))<(int)clip->func.function))
  337.             break;
  338.         clip=clip->next;
  339.     }
  340.  
  341.     Close(file);
  342. }
  343.  
  344. readfile(name,buf,size)
  345. char *name,**buf;
  346. int *size;
  347. {
  348.     int in;
  349.  
  350.     if (CheckExist(name,size)>=0 || !(in=Open(name,MODE_OLDFILE))) return(-1);
  351.     if (!(*buf=AllocMem(*size,MEMF_CLEAR))) {
  352.         Close(in);
  353.         return(-2);
  354.     }
  355.     Read(in,*buf,*size);
  356.     Close(in);
  357.     return(0);
  358. }
  359.  
  360. void init_strings()
  361. {
  362.     int a;
  363.  
  364.     insertbankrmb.txt[0].text=cfg_string[STR_NEW_BANK];
  365.     insertbankrmb.txt[1].text=cfg_string[STR_INSERT_BANK];
  366.     nextbankrmb.txt[0].text=cfg_string[STR_NEXT_BANK];
  367.     nextbankrmb.txt[1].text=cfg_string[STR_LAST_BANK];
  368.     formatclearrmb.txt[0].text=cfg_string[STR_CLEAR];
  369.     formatclearrmb.txt[1].text=cfg_string[STR_CLEAR_LAST];
  370.     sampleclearrmb.txt[0].text=cfg_string[STR_EDIT_SAMPLE];
  371.     sampleclearrmb.txt[1].text=cfg_string[STR_CLEAR];
  372.  
  373.     newtext.IText=cfg_string[STR_MENU_DEFAULT];
  374.     opentext.IText=cfg_string[STR_MENU_OPEN];
  375.     savetext.IText=cfg_string[STR_MENU_SAVE];
  376.     saveastext.IText=cfg_string[STR_MENU_SAVE_AS];
  377.     cuttext.IText=cfg_string[STR_MENU_CUT];
  378.     copytext.IText=cfg_string[STR_MENU_COPY];
  379.     pastetext.IText=cfg_string[STR_MENU_PASTE];
  380.     erasetext.IText=cfg_string[STR_MENU_ERASE];
  381.     clearcliptext.IText=cfg_string[STR_MENU_CLEARCLIPS];
  382.     newclasstext.IText=cfg_string[STR_MENU_NEW];
  383.     editclasstext.IText=cfg_string[STR_MENU_EDIT];
  384.     duplicateclasstext.IText=cfg_string[STR_MENU_DUPLICATE];
  385.     deleteclasstext.IText=cfg_string[STR_MENU_DELETE];
  386.     clearclasstext.IText=cfg_string[STR_CLEAR];
  387.  
  388.     for (a=0;a<5;a++) {
  389.         gadrowstext[a].FrontPen=0;
  390.         gadrowstext[a].DrawMode=JAM1;
  391.         gadrowstext[a].LeftEdge=1;
  392.         gadrowstext[a].TopEdge=1;
  393.         gadrowstext[a].ITextFont=NULL;
  394.         gadrowstext[a].IText=cfg_string[STR_GADGETROWS_NONE+a];
  395.         gadrowstext[a].NextText=NULL;
  396.     }
  397.  
  398.     paintmodetext.IText=cfg_string[STR_NEAT_PAINT_MODE];
  399.  
  400.     projectmenu.MenuName=cfg_string[STR_MENUNAME_CONFIGURE];
  401.     gadrowsmenu.MenuName=cfg_string[STR_MENUNAME_GADGETROWS];
  402.     editmenu.MenuName=cfg_string[STR_EDIT_MENU];
  403.     classmenu.MenuName=cfg_string[STR_MENUNAME_CLASSES];
  404.     neatstuffmenu.MenuName=cfg_string[STR_MENUNAME_NEATSTUFF];
  405.  
  406.     for (a=0;a<3;a++) fileclasstype[a]=cfg_string[STR_FILECLASS_DEFINE+a];
  407.     fileclasstype[3]=cfg_string[STR_FILECLASS_DUPLICATE];
  408.  
  409.     for (a=0;a<9;a++) fontplacenames[a]=cfg_string[STR_FONTPLACE_CLOCK+a];
  410.     fontplacenames[a++]=cfg_string[STR_FONTPLACE_SCREEN];
  411.     fontplacenames[a++]=cfg_string[STR_FONTPLACE_STATUS];
  412.     fontplacenames[a++]=cfg_string[STR_FONTPLACE_TEXTVIEWER];
  413.     fontplacenames[a]=NULL;
  414.  
  415.     palettelist.title=cfg_string[STR_PALETTE_PRESETS];
  416.     iconlistview.title=cfg_string[STR_ICONLIST_TITLE];
  417.  
  418.     for (a=0;a<6;a++) formatnames[a]=cfg_string[STR_FORMAT_NAME+a];
  419.     if (network) {
  420.         formatnames[6]=cfg_string[STR_FORMAT_OWNER];
  421.         formatnames[7]=cfg_string[STR_FORMAT_GROUP];
  422.         formatnames[8]=cfg_string[STR_FORMAT_GROUPBITS];
  423.         formatnames[9]=NULL;
  424.     }
  425.     else formatnames[6]=NULL;
  426.  
  427.     for (a=0;a<3;a++) icontypes[a]=cfg_string[STR_ICONS_DRAWER+a];
  428.  
  429.     for (a=0;a<8;a++) mainmenugads[a]=cfg_string[STR_MAINMENU_GADGETS+a];
  430.     mainmenugads[8]="";
  431.     mainmenugads[9]="";
  432.     mainmenugads[10]=cfg_string[STR_MENU_SAVE];
  433.     mainmenugads[11]=cfg_string[STR_OKAY];
  434.     mainmenugads[12]=cfg_string[STR_CANCEL];
  435.     mainmenugads[13]=NULL;
  436.  
  437.     listviewgads[0]=cfg_string[STR_OKAY];
  438.     listviewgads[1]=cfg_string[STR_CANCEL];
  439.     listviewgads[2]=NULL;
  440.  
  441.     listviewgads2[0]=cfg_string[STR_OKAY];
  442.     listviewgads2[1]=cfg_string[STR_ALL];
  443.     listviewgads2[2]=cfg_string[STR_CANCEL];
  444.     listviewgads2[3]=NULL;
  445.  
  446.     operationgads[0]=cfg_string[STR_MENU_COPY];
  447.     for (a=0;a<7;a++) operationgads[a+1]=cfg_string[STR_OPERATION_DATEFORMAT+a];
  448.     for (a=8;a<11;a++) operationgads[a]="";
  449.     operationgads[11]=cfg_string[STR_OKAY];
  450.     operationgads[12]=cfg_string[STR_CANCEL];
  451.     operationgads[13]=NULL;
  452.  
  453.     for (a=0;a<3;a++) systemgads[a]=cfg_string[STR_SYSTEM_AMIGADOS+a];
  454.     systemgads[3]=cfg_string[STR_HOTKEY];
  455.     for (a=3;a<8;a++) systemgads[a+1]=cfg_string[STR_SYSTEM_AMIGADOS+a];
  456.     systemgads[9]="";
  457.     systemgads[10]="";
  458.     systemgads[11]=cfg_string[STR_OKAY];
  459.     systemgads[12]=cfg_string[STR_CANCEL];
  460.     systemgads[13]=NULL;
  461.  
  462.     gadgetgads[0]=cfg_string[STR_NEXT_BANK];
  463.     gadgetgads[1]=cfg_string[STR_NEW_BANK];
  464.     for (a=0;a<6;a++) gadgetgads[a+2]=cfg_string[STR_GADGET_COPYBANK+a];
  465.     gadgetgads[8]=cfg_string[STR_OKAY];
  466.     gadgetgads[9]=cfg_string[STR_CANCEL];
  467.     gadgetgads[10]=NULL;
  468.  
  469.     for (a=0;a<16;a++) gadflaglist[a]=cfg_string[STR_FLAG_AUTOICONIFY+a];
  470.     gadflaglist[16]=NULL;
  471.  
  472.     editfuncgads[0]=cfg_string[STR_OKAY];
  473.     for (a=1;a<4;a++) editfuncgads[a]="";
  474.     editfuncgads[4]=cfg_string[STR_CANCEL];
  475.     editfuncgads[5]=NULL;
  476.  
  477.     for (a=0;a<5;a++) editfuncgads2[a]=cfg_string[STR_EDIT_NAME+a];
  478.     editfuncgads2[5]=cfg_string[STR_OPERATION_DELETE];
  479.     for (a=5;a<8;a++) editfuncgads2[a+1]=cfg_string[STR_EDIT_NAME+a];
  480.     for (a=9;a<12;a++) editfuncgads2[a]=(char *)-1;
  481.     editfuncgads2[12]="{}";
  482.     editfuncgads2[13]=cfg_string[STR_EDIT_ACTION];
  483.     editfuncgads2[14]=cfg_string[STR_EDIT_CLASS];
  484.     editfuncgads2[15]=NULL;
  485.  
  486.     editclassgads[0]=cfg_string[STR_EDITCLASS_FILECLASS];
  487.     editclassgads[1]=cfg_string[STR_EDITCLASS_CLASSID];
  488.     editclassgads[2]=cfg_string[STR_EDIT_NEWENTRY];
  489.     editclassgads[3]=cfg_string[STR_EDIT_DUPLICATE];
  490.     editclassgads[4]=cfg_string[STR_EDIT_SWAP];
  491.     editclassgads[5]=cfg_string[STR_OPERATION_DELETE];
  492.     editclassgads[6]=(char *)-1;
  493.     editclassgads[7]=(char *)-1;
  494.     editclassgads[8]=cfg_string[STR_EDITCLASS_FILEVIEWER];
  495.     editclassgads[9]=NULL;
  496.  
  497.     for (a=0;a<8;a++) menugadgets[a]=cfg_string[STR_MENU_COPYMENU+a];
  498.     menugadgets[8]=cfg_string[STR_OKAY];
  499.     menugadgets[9]=cfg_string[STR_CANCEL];
  500.     menugadgets[10]=NULL;
  501.  
  502.     drivegadgets[0]=cfg_string[STR_DRIVES_GETDRIVES];
  503.     for (a=0;a<3;a++) drivegadgets[a+1]=cfg_string[STR_GADGET_COPYBANK+a];
  504.     for (a=0;a<5;a++) drivegadgets[a+4]=cfg_string[STR_DRIVES_SORTBANK+a];
  505.     drivegadgets[8]=cfg_string[STR_OKAY];
  506.     drivegadgets[9]=cfg_string[STR_CANCEL];
  507.     drivegadgets[10]=NULL;
  508.  
  509.     drivegadgets2[0]=cfg_string[STR_EDIT_NAME];
  510.     drivegadgets2[1]=cfg_string[STR_EDIT_SAMPLE];
  511.     drivegadgets2[2]="";
  512.     drivegadgets2[3]="";
  513.     drivegadgets2[4]=NULL;
  514.  
  515.     hotkeysgadgets[0]=cfg_string[STR_HOTKEYS_NEWHOTKEY];
  516.     hotkeysgadgets[1]="";
  517.     hotkeysgadgets[2]=cfg_string[STR_OPERATION_DELETE];
  518.     hotkeysgadgets[3]="";
  519.     hotkeysgadgets[4]=cfg_string[STR_EDIT_DUPLICATE];
  520.     hotkeysgadgets[5]=cfg_string[STR_OKAY];
  521.     hotkeysgadgets[6]="";
  522.     hotkeysgadgets[7]=cfg_string[STR_EDIT_SWAP];
  523.     hotkeysgadgets[8]="";
  524.     hotkeysgadgets[9]=cfg_string[STR_CANCEL];
  525.     hotkeysgadgets[10]=NULL;
  526.  
  527.     screengadgets[0]=cfg_string[STR_COLOR_ARROWS];
  528.     for (a=0;a<2;a++) screengadgets[a+1]=cfg_string[STR_SCREEN_COLORS+a];
  529.     screengadgets[3]=cfg_string[STR_SCREEN_GENERAL];
  530.     screengadgets[4]=cfg_string[STR_SCREEN_PALETTE];
  531.     screengadgets[5]=cfg_string[STR_SCREEN_SCREENMODE];
  532.     screengadgets[6]=cfg_string[STR_SCREEN_SLIDERS];
  533.     for (a=7;a<11;a++) screengadgets[a]="";
  534.     screengadgets[11]=cfg_string[STR_OKAY];
  535.     screengadgets[12]=cfg_string[STR_CANCEL];
  536.     screengadgets[13]=NULL;
  537.  
  538.     for (a=0;a<3;a++) palettegadgets[a]=(char *)-1;
  539.     for (a=0;a<3;a++) palettegadgets[a+3]=cfg_string[STR_PALETTE_RED+a];
  540.     palettegadgets[6]=NULL;
  541.  
  542.     for (a=0;a<15;a++) coloursgadgets[a]=cfg_string[STR_COLOR_STATUS+a];
  543.     coloursgadgets[15]=NULL;
  544.  
  545.     for (a=0;a<4;a++) screenmodegadgets[a]=cfg_string[STR_SCREENMODE_WIDTH+a];
  546.     screenmodegadgets[4]=cfg_string[STR_SCREENMODE_DEFAULT];
  547.     screenmodegadgets[5]=cfg_string[STR_SCREENMODE_HALFHEIGHT];
  548.     screenmodegadgets[6]=NULL;
  549.  
  550.     formatgadgets[0]=cfg_string[STR_LISTFORMAT_TITLE];
  551.     formatgadgets[1]=cfg_string[STR_LISTFORMAT_RESET];
  552.     formatgadgets[2]=cfg_string[STR_CLEAR];
  553.     formatgadgets[3]=(char *)-1;
  554.     formatgadgets[4]=cfg_string[STR_LISTFORMAT_REVERSE];
  555.     formatgadgets[5]=cfg_string[STR_LISTFORMAT_NAME];
  556.     formatgadgets[6]=cfg_string[STR_LISTFORMAT_COMMENT];
  557.     formatgadgets[7]=cfg_string[STR_FORMAT_TYPE];
  558.     formatgadgets[8]=cfg_string[STR_FORMAT_OWNER];
  559.     formatgadgets[9]=cfg_string[STR_FORMAT_GROUP];
  560.  
  561.     hotkeygadgets[0]=cfg_string[STR_EDIT_SAMPLE];
  562.     hotkeygadgets[1]=cfg_string[STR_USE_MMB];
  563.     hotkeygadgets[2]=NULL;
  564.  
  565.     for (a=0;a<3;a++) arrowgadtxt[a]=cfg_string[STR_ARROWS_INSIDE+a];
  566.     arrowgadtxt[3]=NULL;
  567.  
  568.     for (a=0;a<3;a++) arrowtypetxt[a]=cfg_string[STR_ARROWTYPE_UPDOWN+a];
  569.  
  570.     filetypeactiongadgets[0]=cfg_string[STR_NEW];
  571.     filetypeactiongadgets[1]="";
  572.     filetypeactiongadgets[2]=cfg_string[STR_EDIT_SWAP];
  573.     filetypeactiongadgets[3]="";
  574.     filetypeactiongadgets[4]=cfg_string[STR_OPERATION_DELETE];
  575.     filetypeactiongadgets[5]=cfg_string[STR_OKAY];
  576.     for (a=6;a<9;a++) filetypeactiongadgets[a]="";
  577.     filetypeactiongadgets[9]=cfg_string[STR_CANCEL];
  578.     filetypeactiongadgets[10]=NULL;
  579.  
  580.     editlists[1].title=cfg_string[STR_EDITLIST_TITLE1];
  581.     editlists[2].title=cfg_string[STR_EDITLIST_TITLE2];
  582.     filetypeactionlist.title=cfg_string[STR_FILETYPEACTIONLIST_TITLE];
  583.     hotkeyslist.title=cfg_string[STR_HOTKEYSLIST_TITLE];
  584.     screenmodeview.title=cfg_string[STR_SCREENMODELIST_TITLE];
  585.     modulelist.title=cfg_string[STR_MODULE_LIST_TITLE];
  586.     languagelist.title=cfg_string[STR_LANGUAGE_LIST_TITLE];
  587.  
  588.     windownames[0]=cfg_string[STR_LEFT_WINDOW];
  589.     windownames[1]=cfg_string[STR_RIGHT_WINDOW];
  590.  
  591.     for (a=0;a<3;a++) separatenames[a]=cfg_string[STR_SEP_MIX_FILES+a];
  592.  
  593.     for (a=0;a<94;a++) commandlist[a]=cfg_string[func_list_items[a]];
  594.     commandlist[94]=NULL;
  595.  
  596.     for (a=0;a<16;a++) arglist[a]=cfg_string[STR_COMMANDSEQ_DESTINATION+a];
  597.     arglist[16]=cfg_string[STR_COMMANDSEQ_VARIABLE];
  598.     arglist[17]=NULL;
  599.  
  600.     for (a=0;a<11;a++) classopslist[a]=cfg_string[STR_CLASSOPS_AND+a];
  601.     classopslist[11]=NULL;
  602.  
  603.     for (a=0;a<4;a++) palettenames[a]=cfg_string[STR_PALETTE_RESET+a];
  604.     for (a=0;a<9;a++) palettenames[a+4]=cfg_string[STR_PALETTE_TINT+a];
  605.     palettenames[13]=NULL;
  606.  
  607.     for (a=0;a<2;a++)
  608.         lsprintf(functypelist[a],"   %-11s %s",
  609.             cfg_string[STR_FTYPE_ACTION],cfg_string[STR_FTYPE_CLICKMCLICK+a]);
  610.     for (a=0;a<10;a++)
  611.         lsprintf(functypelist[a+2],"   %-11s %s",
  612.             cfg_string[STR_FTYPE_COMMAND],ftype_funcs[a]);
  613.  
  614.     fileview_types[0]=cfg_string[STR_FILEVIEW_HEX];
  615.     fileview_types[1]=cfg_string[STR_FILEVIEW_DEC];
  616.  
  617.     for (a=0;a<5;a++) functypestr[a]=cfg_string[STR_FUNCTION_COMMAND+a];
  618.     functypestr[5]="----";
  619.  
  620.     left_right_cycle[0]=cfg_string[STR_SYS_STARTUP_LEFT];
  621.     left_right_cycle[1]=cfg_string[STR_SYS_STARTUP_RIGHT];
  622.     left_right_cycle[2]=NULL;
  623. }
  624.  
  625. void setup_list_window(win,list,gadget,count)
  626. struct NewWindow *win;
  627. struct DOpusListView *list;
  628. struct Gadget *gadget;
  629. int count;
  630. {
  631.     struct Screen *screen;
  632.  
  633.     screen=Window->WScreen;
  634.     list->x=screen->WBorLeft+6;
  635.     list->y=screen->WBorTop+screen->Font->ta_YSize+4;
  636.     win->Width=screen->WBorLeft+screen->WBorRight+list->w+28;
  637.     win->Height=screen->WBorTop+screen->WBorBottom+screen->Font->ta_YSize+list->h+22;
  638.     win->Screen=screen;
  639.     win->LeftEdge=Window->LeftEdge+((Window->Width-win->Width)/2);
  640.     win->TopEdge=Window->TopEdge+((Window->Height-win->Height)/2);
  641.  
  642.     if (gadget) {
  643.         int gspace,goffset,a;
  644.  
  645.         gspace=(win->Width-screen->WBorLeft-screen->WBorRight)/count;
  646.         goffset=((gspace-gadget->Width)/2)+screen->WBorLeft;
  647.  
  648.         for (a=0;a<count && gadget;a++,goffset+=gspace) {
  649.             gadget->LeftEdge=goffset;
  650.             gadget->TopEdge=win->Height-screen->WBorBottom-gadget->Height-2;
  651.             gadget=gadget->NextGadget;
  652.         }
  653.     }
  654. }
  655.